package com.traffic.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.traffic.mapper.PerAccessControlCardsMapper;
import com.traffic.domain.PerAccessControlCards;
import com.traffic.service.IPerAccessControlCardsService;

/**
 * 门卡配置Service业务层处理
 * 
 * @author 郭世纪
 * @date 2024-12-08
 */
@Service
public class PerAccessControlCardsServiceImpl implements IPerAccessControlCardsService 
{
    @Autowired
    private PerAccessControlCardsMapper perAccessControlCardsMapper;

    /**
     * 查询门卡配置
     * 
     * @param cardId 门卡配置主键
     * @return 门卡配置
     */
    @Override
    public PerAccessControlCards selectPerAccessControlCardsByCardId(Long cardId)
    {
        return perAccessControlCardsMapper.selectPerAccessControlCardsByCardId(cardId);
    }

    /**
     * 查询门卡配置列表
     * 
     * @param perAccessControlCards 门卡配置
     * @return 门卡配置
     */
    @Override
    public List<PerAccessControlCards> selectPerAccessControlCardsList(PerAccessControlCards perAccessControlCards)
    {
        return perAccessControlCardsMapper.selectPerAccessControlCardsList(perAccessControlCards);
    }

    /**
     * 新增门卡配置
     * 
     * @param perAccessControlCards 门卡配置
     * @return 结果
     */
    @Override
    public int insertPerAccessControlCards(PerAccessControlCards perAccessControlCards)
    {
        return perAccessControlCardsMapper.insertPerAccessControlCards(perAccessControlCards);
    }

    /**
     * 修改门卡配置
     * 
     * @param perAccessControlCards 门卡配置
     * @return 结果
     */
    @Override
    public int updatePerAccessControlCards(PerAccessControlCards perAccessControlCards)
    {
        perAccessControlCards.setUpdateTime(DateUtils.getNowDate());
        return perAccessControlCardsMapper.updatePerAccessControlCards(perAccessControlCards);
    }

    /**
     * 批量删除门卡配置
     * 
     * @param cardIds 需要删除的门卡配置主键
     * @return 结果
     */
    @Override
    public int deletePerAccessControlCardsByCardIds(Long[] cardIds)
    {
        return perAccessControlCardsMapper.deletePerAccessControlCardsByCardIds(cardIds);
    }

    /**
     * 删除门卡配置信息
     * 
     * @param cardId 门卡配置主键
     * @return 结果
     */
    @Override
    public int deletePerAccessControlCardsByCardId(Long cardId)
    {
        return perAccessControlCardsMapper.deletePerAccessControlCardsByCardId(cardId);
    }
}
